<?php
/******************************************************
v4 - Management Framework
Copyright (C) 2008  Gary Taylor, gMerc Incorporation
http://www.gmerc.com/v4/

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

gary@gmerc.com
******************************************************/
class captcha_image {
  function loaddata() {
    global $masterclass;

    $masterclass->loadmodule('captcha',$masterclass->mainconfig['v4rootdir'].'lib/captcha.lib.php');

  return;
  }
  function display() {
    global $masterclass;
    
    $image=$masterclass->allclasses['captcha']->captcha_generate_image($_SESSION['captcha_val_'.$masterclass->sitevars['captchaid']],200,100);
    if ($image) {
      header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");  
      header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");  
      header("Cache-Control: no-store, no-cache, must-revalidate");  
      header("Cache-Control: post-check=0, pre-check=0", false);  
      header("Pragma: no-cache");
      $masterclass->allclasses['captcha']->captcha_display_image($image);
    } else {
      echo 'Captcha Failed, Feature Broken.';
    }

  return;
  }
}
?>